/****************************************************
          File Name:9-2.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Sun 21 Dec 2014 02:49:05 PM CST
*****************************************************/

#include<iostream>
using namespace std;

void strcount(const string & str)
{
    static int total = 0;
    int count = 0;

    cout << "\"" << str << "\" contants: " << endl;
    count = str.length();
    total += count;

    cout << count << " charactors\n";
    cout << total << " charactors total\n";
}

int main()
{
    string str;
    cout << "Enter a string:";

    getline(cin, str);
    while(str != "")
    {
        strcount(str);
        cout << "Enter next line (empty to quit): ";
        getline(cin, str);
    }

    cout << "Bye!\n";
    return 0;
}
